import productionPlan from "@/api/urls/productionPlan"
import {
  postData,
  getData,
  putData
} from "@/api/axios"

export default {
  //制定生产计划
  maketRegister(data) {
    return postData(productionPlan.maketProductionRegister, data)
  },
  //添加生产计划包含的产品
  addProduct(data) {
    return postData(productionPlan.addRegisterProduct, data)
  },
  //修改审核状态
  updateStatus(productionId, status) {
    return postData(productionPlan.updateStatus + productionId + '/' + status)
  },
  //查询所有未审核的生产计划
  findProductionPlan() {
    return getData(productionPlan.findProductionPlan)
  },
  //查询指定计划产品
  findPlanProdcut(productionId) {
    return getData(productionPlan.findPlanProductUrl + productionId)
  },
  //查询待派工产品
  findAwaitDispatch(checked,dispatchCheck) {
    return getData(productionPlan.findAwaitDispatchUrl + checked +'/' + dispatchCheck)
  },
  //产品派工
  updateDispatch(productionId,productId,dispatchCheck) {
    return putData(productionPlan.updateDispatch + productionId + "/" + productId +'/' + dispatchCheck)
  }
}
